VMX: make vmx_read_guest_msr() cope with callers not checking its return value
authorJan Beulich <jbeulich@suse.com>
Tue, 28 Aug 2018 15:12:05 +0000 (17:12 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 28 Aug 2018 15:12:05 +0000 (17:12 +0200)
commite3a0b9ccf912c298920693a1a4de7f2df08c3f1a
tree9e24d076f6f9051732a50005c88bb795fab80de3
parente3ba4709b7d26c2a14208aa25826058fe5048cb1
VMX: make vmx_read_guest_msr() cope with callers not checking its return value

It took till the 4.5 backports of the L1TF prereqs that gcc 8.2 finally
noticed that the vPMU callers, not checking the function's return value,
may consume uninitialized data. Guard against this by storing zero on
the error path.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/include/asm-x86/hvm/vmx/vmcs.h